package com.aust.furniture.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.aust.furniture.vo.SaleDataForEcharts;
import com.aust.furniture.entity.Saleinfo;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/*家具销售记录的增删改查*/
public interface SaleinfoMapper extends BaseMapper<Saleinfo> {
    @Select("SELECT furniture_name AS `name`, SUM(count) AS `value` FROM saleinfo where  operatetime >= DATE_SUB(CURDATE(), INTERVAL 1 YEAR) GROUP BY furniture_name ")
    List<SaleDataForEcharts> getSaleInfoData();
}
